Skip to content

Conversation

@GabrielBarberini
Copy link
Collaborator

@GabrielBarberini GabrielBarberini commented Nov 1, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Create and update flights using references to existing environments and rockets instead of full definitions
    • Create and update rockets using references to existing motors
    • Enhanced payload validation to accept and properly handle JSON string inputs for complex fields
  • Tests

    • Added comprehensive test coverage for reference-based creation and update workflows

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Warning

Rate limit exceeded

@GabrielBarberini has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c7bb348 and bb16760.

📒 Files selected for processing (12)
  • .github/workflows/pylint.yml (1 hunks)
  • src/controllers/flight.py (2 hunks)
  • src/controllers/rocket.py (2 hunks)
  • src/models/flight.py (2 hunks)
  • src/models/motor.py (2 hunks)
  • src/models/rocket.py (4 hunks)
  • src/routes/flight.py (3 hunks)
  • src/routes/rocket.py (3 hunks)
  • src/services/motor.py (5 hunks)
  • src/services/rocket.py (3 hunks)
  • tests/unit/test_routes/test_flights_route.py (4 hunks)
  • tests/unit/test_routes/test_rockets_route.py (5 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve-api-granularity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces new endpoints to create and update rockets and flights using references to existing resources (motors, environments, rockets) instead of requiring full nested objects. The implementation adds "from-reference" variants of existing POST and PUT endpoints.

Key changes:

  • New request models (RocketWithMotorReferenceRequest, FlightWithReferencesRequest) and partial models (RocketPartialModel, FlightPartialModel) that exclude referenced resources
  • Controller methods to load referenced resources and assemble complete models before persisting
  • Route handlers for /rockets/from-motor-reference, /rockets/{id}/from-motor-reference, /flights/from-references, and /flights/{id}/from-references

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/models/rocket.py Added RocketPartialModel and RocketWithMotorReferenceRequest for motor-referenced rocket creation
src/models/flight.py Added FlightPartialModel and FlightWithReferencesRequest for referenced flight creation
src/controllers/rocket.py Implemented create_rocket_from_motor_reference and update_rocket_from_motor_reference methods with motor loading logic
src/controllers/flight.py Implemented create_flight_from_references and update_flight_from_references methods with environment/rocket loading logic
src/routes/rocket.py Added POST and PUT endpoints for motor-referenced rocket operations
src/routes/flight.py Added POST and PUT endpoints for reference-based flight operations
tests/unit/test_routes/test_rockets_route.py Added comprehensive tests for new rocket endpoints including success and error scenarios
tests/unit/test_routes/test_flights_route.py Added comprehensive tests for new flight endpoints including success and error scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GabrielBarberini GabrielBarberini merged commit 60b4fe4 into master Nov 3, 2025
4 checks passed
@GabrielBarberini GabrielBarberini deleted the improve-api-granularity branch November 3, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants